package Classes.GameViews.ViewPanels
{
	import Classes.GameViews.ViewScenes.VS_Main;
	
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.system.ApplicationDomain;

	public class VP_RewardItemWindon extends ViewPanel
	{
		private static var _instance:VP_RewardItemWindon;
		private var _interfaceUI:Sprite;
		private var dobj:DisplayObject;
		
		public function VP_RewardItemWindon()
		{
			this.init();
		}
		
		private function init():void
		{
			this._interfaceUI=new (ApplicationDomain.currentDomain.getDefinition("RewardWinPanel_v") as Class);
			dobj=this.addChild(this._interfaceUI);
			this.addListener();
		}
		
		/**
		 * 打开获得物品奖励面板
		 */		
		public function openRewardItemWindon(arr:Array):void
		{
			this._interfaceUI["setRewardItems"](arr);
			this.openAt(VS_Main.instance,true);
			this.toCenter();
		}
		
		private function addListener():void
		{
			this.addEventListener("close",closeHandler);
		}
		
		private function closeHandler(e:Event):void
		{
			this.closeWin();
		}
		
		/**
		 *关闭界面 
		 * 
		 */		
		public function closeWin():void
		{
			this.close();
		}
		
		public static function get instance():VP_RewardItemWindon
		{
			if(!_instance)_instance=new VP_RewardItemWindon();
			return _instance;
		}

		public function get interfaceUI():Sprite
		{
			return _interfaceUI;
		}

	}
}